package com.syyai.spring.boot.starter.demo;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.PlatformTransactionManager;

import com.bstek.uflo.env.EnvironmentProvider;

/**
 * 
 * @author zhangyongjie
 *
 */
@Component
public class UlfoEnvironmentProvider implements EnvironmentProvider {
	
	@Autowired
	private SessionFactory sessionFactory;
	@Autowired
	private PlatformTransactionManager platformTransactionManager;
	
	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

	public void setPlatformTransactionManager(
			PlatformTransactionManager platformTransactionManager) {
		this.platformTransactionManager = platformTransactionManager;
	}


	/**
	 * getCategoryId方法返回null，表示不对流程进行分类处理
	 */
	@Override
	public String getCategoryId() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getLoginUser() {
		// TODO Auto-generated method stub
		return "81654";
	}

	@Override
	public PlatformTransactionManager getPlatformTransactionManager() {
		// TODO Auto-generated method stub
		return platformTransactionManager;
	}

	@Override
	public SessionFactory getSessionFactory() {
		// TODO Auto-generated method stub
		return sessionFactory;
	}

}
